<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
 
<s:form id="add_privilege_group_form" name="add_privilege_group_form" method="post" action="group/update.do" onsubmit="return false;">
	<s:hidden id="pgid" name="pgid" />
	<s:hidden id="level" name="level" />
	<table class="form-table">
		<tr>
			<th width="150"><span class="note_red">*</span>系统应用名称：</th>
			<td>
				<mytag:select id="appid" title="系统应用名称" name="appid" sql="applist" isSql="false" listKey="id" listValue="appname" headerKey="" headerValue="请选择"/>
				<span class="descstyle">&nbsp;最大长度不能超过25个字符</span>
			</td>
		</tr>
		<tr>
			<th width="150"><span class="note_red">*</span>名称：</th>
			<td>
				<s:textfield key="groupname" title="请输入名称" cssClass="form-txtinput" id="groupname" maxlength="20" value="%{model.groupname}"/>
				<span class="descstyle">&nbsp;最大长度不能超过25个字符</span>
			</td>
		</tr>
		<tr>
			<th>角色人员：</th>
			<td>
				<table border="0" cellspacing="1" cellpadding="1">
					<tr><td colspan="2" style="border: 0; font-weight: bold;">已有人员</td></tr>
					<tr>
						<td valign="top" style="border: 0">
							<s:select key="selectUserIds" list="%{#request.pglist}" listKey="userid" listValue="realName" id="selected_users_in_group" name="selectUserIds" multiple="true" size="10" style="width: 130px;"/>
						</td>
						<td valign="top" style="border: 0">
							<div>
							<a class="btn_short" title="点击新建用户" href="javascript:void(0)" 
								onClick="Ext.milan.pagejs.page_privilegegroup.selectUsers('selected_users_in_group')">添加</a>
							<a class="btn_short" title="点击新建用户" href="javascript:void(0)" id="del_user_in_group_btn" class="btn-short" style="display: none" 
								onClick="Ext.milan.pagejs.page_privilegegroup.removeUser()">移除</a>
							</div>
							
							<div style="padding-top: 5px;">
								<a class="btn_short" title="点击添加组用户" href="javascript:void(0)" 
									onClick="Ext.milan.pagejs.page_privilegegroup.selectGroupUsers('selected_users_in_group')">添加</a>
								<a class="btn_short" title="点击删除组用户" href="javascript:void(0)" id="del_user_in_pg_btn" class="btn-short" style="display: none" 
									onClick="Ext.milan.pagejs.page_privilegegroup.removeGroupUser()">移除</a>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<th>备注：</th>
			<td>
				<s:textarea key="remark" title="是否输入备注？" class="framingtable2" name="remark" cols="50" rows="5" id="memo" maxlength="100" style="behavior: url('js/maxlength.htc')" value="%{model.remark}"></s:textarea>
				<span class="descstyle">最大长度不能超过100个字符</span>
			</td>
		</tr>
	</table>
	<div class="win-btn-panel">
	    <a class="btn_short" class="btn_short" href="javascript:void(0)" 
			onclick="Ext.milan.pagejs.page_privilegegroup.saveInfo('add_privilege_group_form')">确 定</a>
		<a class="btn_short" class="btn_short" href="javascript:void(0)" 
			onclick="Ext.milan.pagejs.page_privilegegroup.closeWin(false);">取 消</a>
	</div>
</s:form>
<script type="text/javascript"> 
	var selectedUsers = $("selected_users_in_group");
	if(selectedUsers.length > 0) 
		$('del_user_in_group_btn').style.display = "";
</script>
 

